<template>
  <div class="ex-media-service">
    <!--        <div class="ems-title">-->
    <!--            Section Title One-->
    <!--        </div>-->
    <div class="ems-content">
      <div class="ems-card" v-if="section_1" @click="turnTo(section_1.type,section_1.id)">
        <div class="ems-left-img">
          <img :src="section_1.thumbnailUrl">
        </div>
        <div class="ems-right">
          <div class="ems-bg">
            01
          </div>
          <div class="ems-right-title">
            01
          </div>
          <div class="ems-right-content">
            <div>
              {{ section_1.title }}
            </div>
            <div>
              {{ section_1.des }}
            </div>
          </div>
        </div>
      </div>
      <div class="ems-card" v-if="section_2" @click="turnTo(section_2.type,section_2.id)">
        <div class="ems-left-img">
          <img :src="section_2.thumbnailUrl">
        </div>
        <div class="ems-right">
          <div class="ems-bg">
            02
          </div>
          <div class="ems-right-title">
            02
          </div>
          <div class="ems-right-content">
            <div>
              {{ section_2.title }}
            </div>
            <div>
              {{ section_2.des }}
            </div>
          </div>
        </div>
      </div>
      <div class="ems-card" v-if="section_3" @click="turnTo(section_3.type,section_3.id)">
        <div class="ems-left-img">
          <img :src="section_3.thumbnailUrl">
        </div>
        <div class="ems-right">
          <div class="ems-bg">
            03
          </div>
          <div class="ems-right-title">
            03
          </div>
          <div class="ems-right-content">
            <div>
              {{ section_3.title }}
            </div>
            <div>
              {{ section_3.des }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import {ref, h, render, onMounted} from "vue";

const config = useRuntimeConfig();
const apiURL = config.public.apiURL;
const hostURL = config.public.hostURL;

const props = defineProps({
  data: {
    type: Object,
    required: true,
  },
  time: {
    type: String,
    required: false,
  },
});

const section_1 = props.data[0]
const section_2 = props.data[1]
const section_3 = props.data[2]


const router = useRouter();
const turnTo = (type, id) => {
  router.push({
    path: `/${type}/${id}`
  })
  // window.open(`${hostURL}/${type}/${id}`);
}
</script>
<style scoped lang="scss">
.ex-media-service {
  width: 1600px;
  // height: 964px;
  background-color: #fff;
  padding: 0 160px;
  padding-top: 114px;

  .ems-title {
    //font-family: FZLanTingHeiS-EB-GB, FZLanTingHeiS-EB-GB;
    font-weight: 600;
    font-size: 30px;
    color: #30363A;
    margin-bottom: 30px;
  }

  .ems-content {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;

    .ems-card {
      width: 480px;
      height: 184px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding-bottom: 24px;
      cursor: pointer;
      transition: border-bottom .3s;

      // margin-right: 60px;
      .ems-left-img {
        width: 153px;
        height: 160px;
        background-color: rgba(0, 0, 0, 0.1);
        margin-right: 24px;
        overflow: hidden;

        img {
          width: 153px;
          height: 160px;
          max-width: 153px;
          object-fit: cover;
          transition: all 0.6s;
        }


      }

      .ems-right {
        position: relative;
        display: inline-flex;
        width: calc(100% - 153px - 24px);
        height: 158px;
        flex-direction: column;
        justify-content: space-between;

        .ems-bg {
          position: absolute;
          right: 0;
          top: 0;
          font-size: 100px;
          font-weight: 600;
          background-image: linear-gradient(180deg, rgba(199, 142, 102, 0.1) 0%, rgba(199, 142, 102, 0) 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
        }

        .ems-right-title {
          color: #C78E66;
          font-size: 20px;

        }

        .ems-right-content {
          color: #000;

          > div {
            &:first-child {
              font-weight: 600;
              font-size: 16px;
              margin-bottom: 12px
            }

            &:last-child {
              font-size: 12px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
            }
          }
        }
      }
    }

    .ems-card:hover .ems-left-img img {
      transform: scale(1.05);
    }

    .ems-card:hover {
      border-bottom: 1px solid #C78E66;
    }
  }

  .ems-big-title {
    width: 100%;
    padding-top: 200px;
    padding-bottom: 100px;
    text-align: center;
    font-size: 64px;
    font-weight: 600;
    color: #30363A;
  }

  .ems-btns {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0px;

    .per-btn {
      width: 200px;
      text-align: center;

      img {
        width: 72px;
        height: 72px;
      }

      > div {
        width: 100%;
        text-align: center;
        font-size: 16px;
      }
    }
  }
}
</style>